<?php

namespace App\Http\Requests;

use Illuminate\Support\Arr;

class EventRequest extends FormRequest
{
    public function rules()
    {
        $id = (int) optional($this->route('event'))->id;
        $rules = [
            'event_status' => 'required',
            'feedback' => 'string',
        ];
        if ($this->isMethod('put')) {
            $rules = Arr::only($rules, $this->keys());
        }

        return $rules;
    }

    public function messages()
    {
        return [
            //
        ];
    }

    public function attributes()
    {
        return [
            'event_status' => '1;已通过2：未通过3：已结伴 4未结伴',
            'feedback' => '反馈意见',
        ];
    }
}
